package lab02.test03;

public class Student {
    //属性 :计算机成绩、数学成绩、英语成绩
    float computerScore;
    float matchScore;
    float englishScore;

    //行为 :求总分、平均分、最高分、最低分 并且可以输出一个学生的完整信息

    float sum(){
        return computerScore+matchScore+englishScore;
    }

    float average(){
        return (computerScore+matchScore+englishScore)/3;
    }


    float  maxScore(){
        if(computerScore>englishScore&&computerScore>matchScore)
            return computerScore;
        else if (matchScore>englishScore&&matchScore>computerScore)
            return matchScore;
        else return englishScore;
    }
    float minScore() {
        if (computerScore < matchScore && computerScore < englishScore)
            return computerScore;
        else if (matchScore < englishScore && matchScore < computerScore)
            return matchScore;
        else return englishScore;
    }
    float printfScore(){
        System.out.println(sum());
        System.out.println(average());
        System.out.println(maxScore());
        System.out.println(minScore());
        return printfScore();
//打印
    }
}
